package pattern.behavior.observer.spring;

import cn.hutool.json.JSONUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

/**
 * @author : Rookie
 * @description :
 * @date : 2023/8/26
 */
@Component
@Slf4j
public class CustomEventListener implements ApplicationListener<CustomEvent> {

    @Override
    public void onApplicationEvent(CustomEvent event) {
        log.info("收到消息：{}", JSONUtil.toJsonStr(event.getSource()));
    }
}
